TOP:=${PWD}

LDFLAGS_GLOBAL=

#  standard common Makefile fragment
all: all_targets

include $(TOP)/build/extra.mk

#  include relevant component Makefile fragments
dir:=$(TOP)/opendpi
include $(dir)/opendpi.mk

dir:=$(TOP)/memoryOperation
include $(dir)/memoryOperation.mk

dir:=$(TOP)/advanceDetect
include $(dir)/advanceDetect.mk

dir:=$(TOP)/output
include $(dir)/output.mk

TARGET = opendpi.sdp

LIBS_LIST := $(LIBS_LIST) $($(TARGET)-LIBS)
OBJS := $(OBJS) 

CFLAGS_LOCAL = -g -O2 -W -Wall -Wno-unused-parameter
CFLAGS_LOCAL += $($(TARGET)-FLAGS)

CFLAGS_GLOBAL += -I$(TOP)/opendpi/include
LDFLAGS_GLOBAL += -lpcap -ldl -lm -lrt -L/usr/lib64/mysql -lmysqlclient $(LIBEVENT)

include $(TOP)/build/application.mk

CLEAN_LIST += $(OBJS)
CLEAN_LIST += $(OBJS:.o=.d)
CLEAN_LIST += $(GEN_C_FILES)

all_targets:$(DYNLIB_DIR)
#	for t in $(DYN_LIBS_LIST); do $(MAKE) DYNLIB=$$t application-target|| exit -1;done
	@$(MAKE) application-target
zip:
	git archive --format=zip --prefix=sklcc-dpi/ HEAD > sklcc-dpi.zip
cstags:
	find $(PWD) -name "*.[ch]" -type f > cscope.files;cscope -b

clean:
	rm -f $(TARGET)
	rm -f $(CLEAN_LIST)

clobber: clean
	rm -rf $(OBJ_DIR) $(DYNLIB_DIR)


